home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / MotifApp / ColorChooser.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-17  |  2.0 KB  |  71 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////
  3. //         This example code is from the book:
  4. //
  5. //           Object-Oriented Programming with C++ and OSF/Motif
  6. //         by
  7. //           Douglas Young
  8. //           Prentice Hall, 1992
  9. //           ISBN 0-13-630252-1    
  10. //
  11. //         Copyright 1991 by Prentice Hall
  12. //         All Rights Reserved
  13. //
  14. //  Permission to use, copy, modify, and distribute this software for 
  15. //  any purpose except publication and without fee is hereby granted, provided 
  16. //  that the above copyright notice appear in all copies of the software.
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21. //////////////////////////////////////////////////////////
  22. // ColorChooser.h
  23. //////////////////////////////////////////////////////////
  24. #ifndef COLORCHOOSER_H
  25. #define COLORCHOOSER_H
  26. #include "UIComponent.h"
  27.  
  28. typedef void ( *ColorSelectedCallback ) ( int, int, int, void * );
  29. typedef void ( *CancelCallback ) ( void * );
  30.  
  31. class ColorModel;
  32. class ColorView;
  33.  
  34. class ColorChooser : public UIComponent {
  35.     
  36.   private:
  37.     
  38.     ColorModel    *_model;
  39.     ColorView     *_rgbSliders;
  40.     ColorView     *_swatch;
  41.     ColorView     *_rgbView;
  42.     ColorView     *_hsvView;
  43.  
  44.     void  *_clientData;
  45.     Widget _okButton;
  46.     Widget _cancelButton;
  47.     
  48.     ColorSelectedCallback _okCallback;
  49.     CancelCallback        _cancelCallback;
  50.     
  51.     void   ok();
  52.     void   cancel();
  53.     
  54.     static void okCallback ( Widget, 
  55.                 XtPointer, 
  56.                 XtPointer );
  57.  
  58.     static void cancelCallback ( Widget, 
  59.                 XtPointer, 
  60.                 XtPointer );
  61.     
  62.   public:
  63.     
  64.     ColorChooser ( Widget , char *);
  65.     virtual ~ColorChooser ();
  66.     void pickColor ( ColorSelectedCallback, CancelCallback, void * );
  67.     
  68.     virtual const char *const className() { return "ColorChooser"; }
  69. };
  70. #endif
  71.